🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / fdroid / kotlin / org / meshtastic / app / map / component / SitePlannerSlot.kt
Displaying Raw • Download
androidApp/src/fdroid/kotlin/org/meshtastic/app/map/component/SitePlannerSlot.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 2.94 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map.component
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.runtime.getValue
Tff7b72import T7ee787androidx.lifecycle.compose.collectAsStateWithLifecycle
Tff7b72import T7ee787org.koin.compose.viewmodel.koinViewModel
Tff7b72import T7ee787org.maplibre.spatialk.geojson.Position
Tff7b72import T7ee787org.meshtastic.app.map.MapViewModel
Tff7b72import T7ee787org.meshtastic.app.map.SitePlannerHost
Tff7b72import T7ee787org.meshtastic.feature.map.SharedMapViewModel
Tff7b72import T7ee787org.meshtastic.feature.map.component.toSitePlannerParams
Tff7b72import T7ee787org.meshtastic.feature.map.maplibre.SitePlannerSession
T8b949e/**
* Runs the hosted Site Planner for the F-Droid map.
*
* The planner lives in `androidApp`, so the flavor supplies it rather than the shared map module. Imported coverage
* becomes a GeoJSON map layer (see #6138) and the map recentres on the transmitter so it is on screen.
*
* No phone-GPS shortcut is offered: the Google flavor fills that from Play Services' fused location, which must not
* enter an F-Droid build. The coordinate fields stay manual, with the map centre and the node's own position as
* shortcuts.
*/
Tf0883e@Composable
Tff7b72fun Td2a8ffSitePlannerSlotTb4b4b4(Te6edf3sessionTb4b4b4: Te6edf3SitePlannerSessionTb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3sharedViewModelTb4b4b4: Te6edf3SharedMapViewModel Tff7b72= Te6edf3koinViewModelTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3mapViewModelTb4b4b4: Te6edf3MapViewModel Tff7b72= Te6edf3koinViewModelTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3ourNode Tff7b72by Te6edf3sharedViewModelTb4b4b4.Te6edf3ourNodeInfoTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3channelSet Tff7b72by Te6edf3sharedViewModelTb4b4b4.Te6edf3channelSetTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
Tff7b72val Te6edf3nodes Tff7b72by Te6edf3sharedViewModelTb4b4b4.Te6edf3nodesTb4b4b4.Te6edf3collectAsStateWithLifecycleTb4b4b4(Tb4b4b4)
T8b949e// A deep link names the node to plan for; a toolbar launch plans for whatever we are connected to.
Tff7b72val Te6edf3subject Tff7b72= Te6edf3sessionTb4b4b4.Te6edf3nodeNumTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3num Tff7b72-Tff7b72> Te6edf3nodesTb4b4b4.Te6edf3firstOrNull Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3num Tff7b72=Tff7b72= Te6edf3num Tb4b4b4} Tb4b4b4} Tff7b72?: Te6edf3ourNode
Te6edf3SitePlannerHostTb4b4b4(
Te6edf3initialParams Tff7b72= Te6edf3subjectTb4b4b4.Te6edf3toSitePlannerParamsTb4b4b4(Te6edf3channelSetTb4b4b4)Tb4b4b4,
Te6edf3onDismiss Tff7b72= Te6edf3sessionTb4b4b4.Te6edf3onDismissTb4b4b4,
Te6edf3onImport Tff7b72= Tb4b4b4{ Te6edf3nameTb4b4b4, Te6edf3geoJsonTb4b4b4, Te6edf3latitudeTb4b4b4, Te6edf3longitude Tff7b72-Tff7b72>
Te6edf3mapViewModelTb4b4b4.Te6edf3addGeoJsonLayerTb4b4b4(Te6edf3nameTb4b4b4, Te6edf3geoJsonTb4b4b4)
Te6edf3sessionTb4b4b4.Te6edf3moveToTb4b4b4(Te6edf3PositionTb4b4b4(Te6edf3longitude Tff7b72= Te6edf3longitudeTb4b4b4, Te6edf3latitude Tff7b72= Te6edf3latitudeTb4b4b4)Tb4b4b4)
Tb4b4b4}Tb4b4b4,
Te6edf3onUseNodeLocation Tff7b72=
Te6edf3subjectTff7b72?.Te6edf3takeIf Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3validPosition Tff7b72!Tff7b72= Tff7b72null Tb4b4b4}Tff7b72?.Te6edf3let Tb4b4b4{ Te6edf3node Tff7b72-Tff7b72> Tb4b4b4{ Te6edf3nodeTb4b4b4.Te6edf3latitude Te6edf3to Te6edf3nodeTb4b4b4.Te6edf3longitude Tb4b4b4} Tb4b4b4}Tb4b4b4,
Te6edf3onUseMapCenter Tff7b72= Tb4b4b4{ Te6edf3sessionTb4b4b4.Te6edf3mapCenterTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3let Tb4b4b4{ Tffa657itTb4b4b4.Te6edf3latitude Te6edf3to Tffa657itTb4b4b4.Te6edf3longitude Tb4b4b4} Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Served by rngit 1.5.2 - Generated in 0.1s